package ruler.rules;

import java.util.HashMap;

import android.os.Parcel;
import android.os.Parcelable;

public class notRule extends Rule {
	private Rule r1;
	
	public notRule(){}
	public notRule(String n, Rule a){
		super(n);
		this.r1=a;
	}
	
	public notRule(int id, String name, String description,
			DEVICE_TYPE device_type, RULE_TYPE rule_type, String packageName,
			boolean whenRunning, boolean enable_device, Rule r) {
		super(id, name, description, device_type, rule_type, packageName, whenRunning, enable_device);
		this.r1=r;
	}
	
	public notRule(Parcel in) {
		super(in);
	}
	
	public static final Parcelable.Creator<notRule> CREATOR = new Parcelable.Creator<notRule>() {
		public notRule createFromParcel(Parcel in) {
			return new notRule(in);
		}
		public notRule[] newArray(int size) {
			return new notRule[size];
		}
	};
	
	public boolean isValid(HashMap<String, RULE_TYPE> hasMap) { 
		return !this.r1.isValid(hasMap);
	}

}
